/*
 * @Author: chengrong.liu chengrong.liu@i-tudou.com
 * @Date: 2025-02-12 17:10:07
 * @LastEditors: chengrong.liu chengrong.liu@i-tudou.com
 * @LastEditTime: 2025-02-13 17:36:02
 * @FilePath: \hotel-manager\src\store\user.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { defineStore} from 'pinia'

export default defineStore('user', {
  state() {
    return {
      user: {
        loginId: ''
      }
    }
  },
  actions: {
    setUser(user: object) {
      this.user = user
    },
    clearUser() {
      sessionStorage.clear()
      this.user = {
          loginId: ''
      }
    }
  }
}, 
{
  persist:true
})